<template>
<div>
  <!-- 导航 -->
    <el-breadcrumb separator-class="el-icon-arrow-right">
      <el-breadcrumb-item :to="{ path: '/home' }">首页</el-breadcrumb-item>
      <el-breadcrumb-item >常数类别管理</el-breadcrumb-item>
    </el-breadcrumb>
  <el-table :data="tableData" border style="width: 100%">
    <el-table-column fixed prop="id" label="id"></el-table-column>
    <el-table-column prop="constanttypecode" label="常数类别编码"></el-table-column>
    <el-table-column prop="constanttypename" label="常数类别名称"></el-table-column>

    <el-table-column fixed="right" label="操作">
      <template slot-scope="scope">
        <el-button @click="handleClick(scope.row)" type="text" size="small">查看详情</el-button>
      </template>
    </el-table-column>
  </el-table>
</div>
  
</template>

<script>
export default {
  data() {
    return {
      tableData: [
        {
          id: "1",
          constanttypecode: "DeptCategory",
          constanttypename: "科室分类",
          delmark: "1",
        },
      ],
    };
  },
  methods: {
    handleClick(row) {
      this.$router.push({
        path: "/constantitem",
        query: {
          id: row.id,
        },
      });
    },
    // listConstanttype() {
    //   const _this = this;
    //   this.$http
    //     .post("http://localhost:8085/his/constanttype/findAll1")
    //     .then(function (resp) {
    //       console.log(resp)
    //       // console.log(resp.data.list)
    //       _this.tableData = resp.data[0];

    //     });
    // },
    async listConstanttype() {
      const { data: res } = await this.$http.post("constanttype/findAll1", {
        id: 1,
      });
      this.tableData = res.list;

      console.log(res.list);
    },
  },

  created() {
    this.listConstanttype();
  },
};
</script>